package com.itheima.d4_proxy;

public class Demo01 {
    public void main(String[] args) {
        BaoQiang baoQiang = new BaoQiang();
        Songjj songjj = new Songjj(baoQiang);
        songjj.liveshow(10000);
        songjj.sleep();

    }

public class Songjj implements Star{
    BaoQiang baoQiang;

    public Songjj(BaoQiang baoQiang) {
        this.baoQiang = baoQiang;
    }

    @Override
    public double liveshow(double money) {
        System.out.println("宋积极拉了一场表演装了"+money);
        double baoqiangmoney = baoQiang.liveshow(money * 0.1);
        System.out.println("宝强赚了"+baoqiangmoney);

        return baoqiangmoney;
    }

    @Override
    public void sleep() {
        System.out.println("送积极订房");
        baoQiang.sleep();
        System.out.println("送积极退房");
    }
}

public class BaoQiang implements Star{
    @Override
    public double liveshow(double money) {
        System.out.println("宝强赚了"+money);
        return money;
    }

    @Override
    public void sleep() {
        System.out.println("累了睡觉");
    }
}

interface Star{
    double liveshow(double money);

    void sleep();
}
}
